/*
 * IncomeStatement.h
 *
 *  Created on: Mar 26, 2014
 *      Author: alexander
 */

#ifndef INCOMESTATEMENT_H_
#define INCOMESTATEMENT_H_

#include <string>
#include <vector>
#include <map>
#include <iostream>

#include <Poco/StringTokenizer.h>
#include <Poco/String.h>
#include <Poco/NumberParser.h>
#include <Poco/DateTimeParser.h>
#include <Poco/DateTime.h>
#include <Poco/RegularExpression.h>

#include <global.h>

class FinancialData
{
public:
//	void parseWebPageAndSet(const std::vector<std::string>& webPageSource,
//			const std::vector<std::string>& CATEGORIES);
	virtual ~FinancialData() { };
	void setValue(std::string category, std::string year, float value) {
		values[category][year] = value;
	}
	const std::map<std::string, std::map<std::string, float> >& getValues() const {
		return values;
	}

	;

protected:
//	std::map<std::string, float> values;
	std::map<std::string, std::map<std::string, float>> values;
};

class IncomeStatement: public FinancialData
{
public:
	static const std::vector<std::string> CATEGORIES;
	static const std::vector<std::string> CATEGORIES_PER_SHARE;
	std::map<std::string, std::map<std::string, float>>& parseWebPageAndSet(const std::vector<std::string>& webPageSource);
	std::map<std::string, std::map<std::string, float>> getValues() const {
			return values;
		}
};

class BalanceSheet: public FinancialData
{
public:
	static const std::vector<std::string> CATEGORIES;
	std::map<std::string, std::map<std::string, float>>& parseWebPageAndSet(const std::vector<std::string>& webPageSource);
};

class CashFlow: public FinancialData
{
public:
	static const std::vector<std::string> CATEGORIES;
	std::map<std::string, std::map<std::string, float>>& parseWebPageAndSet(const std::vector<std::string>& webPageSource);
};

class FinancialRatios: public FinancialData
{
public:
	static const std::vector<std::string> CATEGORIES;
	std::map<std::string, std::map<std::string, float>>& parseWebPageAndSet(const std::vector<std::string>& webPageSource);
};

class KeyStatistics: public FinancialData
{
public:
	static const std::vector<std::string> CATEGORIES;
	std::map<std::string, float>& parseWebPageAndSet(const std::vector<std::string>& webPageSource);

private:
	std::map<std::string, float> values;
};

#endif /* INCOMESTATEMENT_H_ */
